package com.caesar.method_son;

import com.caesar.method_fa.Employee;

/**
 * @author caesar
 * @date 2025/7/9
 * @Description:小时工
 * @apiNote
 */
public class HourEmployee extends Employee {
    private double hours;//工作时间
    private double wage;//每小时工资

    public HourEmployee() {
    }

    public HourEmployee(String name, double hours, double wage) {
        super(name);
        this.hours = hours;
        this.wage = wage;
    }

    public double getHours() {
        return hours;
    }

    public void setHours(double hours) {
        this.hours = hours;
    }

    public double getWage() {
        return wage;
    }

    public void setWage(double wage) {
        this.wage = wage;
    }

    @Override
    public double earning() {
        return hours * wage;
    }

    @Override
    public String getBasicInfo() {
        return "职位：小时工" + "\t姓名：" + getName() + "\t时薪；" + wage + "\t工时：" + hours;
    }
}
